package com.settlement.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.settlement.system.common.base.BaseEntity;
import com.settlement.system.common.enums.DeleteEnum;
import com.settlement.system.common.enums.NoMatchRecordStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
* <p>
* 转换不到账单记录表
* </p>
*
* @author huangrensen
* @since 2024-08-09
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NoMatchRecord extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
    * 主键
    */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;


    /**
    * 店铺ID
    */
    private Long storeId;
    @TableField(exist = false)
    private String storeName;


    /**
    * 原始单据id
    */
    private String dataId;

    /**
     * 商户订单号
     */
    private String sellerOrderNo;

    /**
     * 原始单据类型
     */
    private String billType;


    /**
    * 表名前缀
    */
    private String tableNamePreFix;


    /**
    * 字典类型CODE
    */
    private String dictCode;


    /**
    * 账单月份
    */
    private String billMonth;


    /**
    * 原始数据
    */
    @TableField(exist = false)
    private String dataMap;


    /**
    * 0 未删除 1 已删除
    */
    private Integer deleted = DeleteEnum.NO.getValue();

    private Integer status = NoMatchRecordStatusEnum.RUNNING.getValue();
    @TableField(exist = false)
    private String statusName;

    private String remark;

    // 截取长度超出范围的字段
    public void cutString() {
        if (this.remark != null && this.remark.length() > 600) {
            this.remark = this.remark.substring(0, 600);
        }
    }

}
